import request from '@/utils/request'

/**
 * {id}根据ID查询  常规奖惩管理
 * @param {*} id
 * @returns
 */
export const queryRPById = async(id) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine/${id}`,
    method: 'get'
  })
  return res
}

/**
 * 常规奖惩新增
 * @param {*} params
 * @returns
 */
export const addRP = async(params) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine`,
    method: 'POST',
    data: params
  })
  return res
}

/**
 * 常规奖惩修改
 * @param {*} params
 * @returns
 */
export const modifyRP = async(params) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine`,
    method: 'PUT',
    data: params
  })
  return res && res.data
}

/**
 * 常规奖惩删除
 * @param {*} ids
 * @returns
 */
export const delRP = async(ids) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine/deleteByIds`,
    method: 'post',
    data: ids
  })
  return res
}

/**
 * 常规奖惩停用
 * @param {*} id
 * @returns
 */
export const disableRP = async(ids) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine/disable`,
    method: 'post',
    data: ids
  })
  return res
}
/**
 * 常规奖惩启用
 * @param {*} id
 * @returns
 */
export const enableRP = async(ids) => {
  const res = await request({
    url: `/api/v1/rewardPunishmentRoutine/enable`,
    method: 'post',
    data: ids
  })
  return res
}

// 非公司品牌 新增
export const outherAdd = async(params) => {
  const res = await request({
    url: '/api/v1/nonCorporateBrandProcessing/add',
    method: 'post',
    data: params
  })
  return res
}

// 非公司品牌 详情
export const outherBrandgetById = async(id) => {
  const res = await request({
    url: `/api/v1/nonCorporateBrandProcessing/getById/${id}`,
    method: 'get'
  })
  return res
}

// 非公司品牌 编辑
export const outherBrandEdit = async(params) => {
  const res = await request({
    url: '/api/v1/nonCorporateBrandProcessing/edit',
    method: 'post',
    data: params
  })
  return res
}

// 非公司品牌 停用
export const outherBrandDisable = async(params) => {
  const res = await request({
    url: '/api/v1/nonCorporateBrandProcessing/disable',
    method: 'post',
    data: params
  })
  return res
}

// 非公司品牌 启用
export const outherBrandEnable = async(params) => {
  const res = await request({
    url: '/api/v1/nonCorporateBrandProcessing/enable',
    method: 'post',
    data: params
  })
  return res
}
// 非公司品牌 删除
export const outherBrandDel = async(params) => {
  const res = await request({
    url: '/api/v1/nonCorporateBrandProcessing/deleteBatch',
    method: 'delete',
    data: params
  })
  return res
}
